package com.bank.action;

import java.util.List;

import javax.annotation.Resource;

import org.apache.struts2.ServletActionContext;
import org.springframework.stereotype.Controller;

import com.bank.svc.MgrLogSvc;
import com.bank.tools.JSONOutput;
import com.bank.vo.BankLogResult;
import com.google.gson.Gson;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
@Controller("bankLogAction")
public class BankLogAction extends ActionSupport{
	@Resource(name="mgrLogSvc")
	private MgrLogSvc mls;
	private int pageNum;
	
	public String getLogList() throws Exception{
		List<BankLogResult> list=mls.getLogByPage(pageNum);
		String json=new Gson().toJson(list);
		JSONOutput.OutputJSON(ServletActionContext.getResponse(), json);
		return "success";
	}
	
	public void setMls(MgrLogSvc mls) {
		this.mls = mls;
	}
	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}
}
